<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			* {
				margin: 0% auto;
				padding: 0%;

			}

			.box {
				/* 规定盒子的大小 */
				text-align: center;
				font-size: 400px;
				width: 1000px;
				position: relative;
				top: 50px;
				color: red;
			}

			button {
				/* 绝对定位 */
				height: 60px;
				width: 200px;
				border-radius: 50px;
				border: none;
				background: #111;
				color: #fff;
				font-size: 20px;
				/* 字体间隔 */
				letter-spacing: 4px;
				cursor: pointer;
				position: relative;
				top: -400px;

			}
		</style>
		<script type="text/javascript">
			var oTimer = 0;
			var tmp = 0;

			function stop() {
				window.clearInterval(oTimer);
			}

			function start() {
				oTimer = setInterval("randomNum()", 100); //设置时间间隔2

			}

			function randomNum() {
				tmp = (parseInt(Math.random() * (10 - 1 + 1) + 1));
				document.getElementById('updateId').innerHTML = tmp;
			}

			function reset() {
				tmp = 0;
				document.getElementById('updateId').innerHTML = tmp;
			}
		</script>
	</head>
	<body>
		<div class="box">
			<div id="updateId">0</div>
			<button onclick="start()">开始</button>
			<button onclick="stop()">暂停</button>
			<button onclick="reset()">复位</button>
		</div>
	</body>
</html>
